4############################################################## 
## MOD Title: Topic's Check Statuses
## MOD Author: Lektor < lektor@normaplus.com >
## MOD Description: This mod lets your moderators to manage the dl forums easier by checking and giving certain statuses to certain topics.
## MOD Version: 0.9.1
## 
## Installation Level: (Easy)
## Installation Time: 5 minutes
## Files To Edit:  
##		viewforum.php
##		download.php
##		tracker.php
##		includes/constants.php
##		attach_mod/displaying_torrent.php
##		templates/subsilver/viewforum_torrent.tpl
##		templates/subsilver/viewtopic_attach_body.tpl
##		templates/subsilver/admin/forum_edit_body.tpl
##		templates/subsilver/viewforum_torrent.tpl
##		admin/admin_forums.php
##
## Included Files: 
##		topic_check_status.php
##		includes/function_sendpm.php
##
############################################################## 
## For Security Purposes, Please Check: http://www.phpbbguru.net/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. 
############################################################## 
## Author Notes: n/a
############################################################## 
## MOD History: 
## 
##   2008-07-13 Version 0.9.1 
##      - add ability to sort topics on tracker.php depending on check status
##      - changed date format of 'who checked' from 1-12h  to 00-23h
##      - users can see topics' status on viewforum page
##
##   2008-06-18 Version 0.8.0 
##      - Initial Release
##
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
#
#-----[ SQL ]------------------------------------------
#
CREATE TABLE IF NOT EXISTS `phpbb_topics_move` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `forum_id` smallint(5) unsigned NOT NULL default '0',
  `waits_days` smallint(5) unsigned NOT NULL default '0',
  `check_freq` smallint(5) unsigned NOT NULL default '0',
  `move_fid` smallint(5) unsigned NOT NULL default '0',
  `recycle_waits_days` smallint(5) unsigned NOT NULL default '0',
  `recycle_check_freq` smallint(5) unsigned NOT NULL default '0',
  `recycle_move_fid` smallint(5) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `forum_id` (`forum_id`)
);

ALTER TABLE `phpbb_forums` ADD `move_next` int(11) UNSIGNED DEFAULT '0' NOT NULL ;
ALTER TABLE `phpbb_forums` ADD `recycle_move_next` int(11) UNSIGNED DEFAULT '0' NOT NULL ;
ALTER TABLE `phpbb_forums` ADD `move_enable` tinyint( 1 ) UNSIGNED DEFAULT '0' NOT NULL ;

ALTER TABLE `phpbb_bt_torrents` ADD `topic_check_status` TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL ;
ALTER TABLE `phpbb_bt_torrents` ADD `topic_check_uid` MEDIUMINT( 8 ) UNSIGNED DEFAULT '0' NOT NULL ;
ALTER TABLE `phpbb_bt_torrents` ADD `topic_check_date` int(11)  DEFAULT '0' NOT NULL ;
ALTER TABLE `phpbb_bt_torrents` ADD `topic_check_first_fid` MEDIUMINT( 8 )  DEFAULT '0' NOT NULL ;
ALTER TABLE `phpbb_bt_torrents` ADD `topic_check_duble_tid` MEDIUMINT( 8 )  DEFAULT '0' NOT NULL ;

#
#-----[ COPY ]------------------------------------------
#
copy root/*.* to *.*

#
#-----[ OPEN ]------------------------------------------
#
viewforum.php

#
#-----[ FIND ]------------------------------------------
#
//
// End of forum prune
//

#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Do the forum topics move
//
        if ( $forum_row['move_next'] < time() && $forum_row['move_enable'] )
        {
                require_once($phpbb_root_path . 'includes/function_topics_move.'.$phpEx);
                topics_move($forum_id, 3);
        }
        if ( $forum_row['recycle_move_next'] < time() && $forum_row['move_enable'] )
        {
                require_once($phpbb_root_path . 'includes/function_topics_move.'.$phpEx);
                require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
                topics_move($forum_id, 5);
        }
//
// End of forum topics move
//

#
#-----[ FIND ]------------------------------------------
#
		$template->assign_block_vars('topicrow', array(

#
#-----[ BEFORE, ADD ]------------------------------------------
#
	if (isset($topic_tor[$topic_id]))
	{
		 switch ($topic_tor[$topic_id]['topic_check_status'])
		         {
		         case 1: $topic_check_status='<span style="color:indigo;">&#9674;</span>'; break; 
		         case 2: $topic_check_status='<span style="color:green;">&radic;</span>'; break; 
		         case 3: $topic_check_status='<span style="color:#E6C506;">&#8776;</span>'; break; 
		         case 4: $topic_check_status='<span style="color:red;">&#8800;</span>'; break; 
		         case 5: $topic_check_status='<span style="color:blue;">&#8734;</span>'; break; 
		         default: $topic_check_status='<span style="color:red;">?</span>';
		         }
	}

#
#-----[ FIND ]------------------------------------------
#
			'LAST_POST_IMG' => $last_post_url, 

#
#-----[ AFTER, ADD ]------------------------------------------
#
			'TOPIC_CHECK_STATUS' => (isset($topic_tor[$topic_id]))?$topic_check_status." &#183; ":"",
#
#-----[ OPEN ]------------------------------------------
#
download.php

#
#-----[ FIND ]------------------------------------------
#
$sql = 'SELECT *
	FROM ' . ATTACHMENTS_DESC_TABLE . "
	WHERE attach_id = $download_id";

#
#-----[ REPLACE, WITH ]------------------------------------------
#
$sql = 'SELECT at.*, btt.topic_check_status
   FROM ' . ATTACHMENTS_DESC_TABLE . ' at
   LEFT JOIN '.BT_TORRENTS_TABLE.' btt on btt.attach_id=at.attach_id
   WHERE at.attach_id = ' . $download_id;

#
#-----[ FIND ]------------------------------------------
#
		send_file_to_browser($attachment, $upload_dir);

#
#-----[ REPLACE, WITH ]------------------------------------------
#
		if (in_array($attachment['topic_check_status'], array(4, 5)))
		{
			message_die(GENERAL_ERROR, "<br /><b> torrent   .</b>");
		}else{
			send_file_to_browser($attachment, $upload_dir);
		}

#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]------------------------------------------
#
// Table names

#
#-----[ AFTER, ADD ]------------------------------------------
#
define('TOPICS_MOVE_TABLE', $table_prefix.'topics_move');

#
#-----[ OPEN ]------------------------------------------
#
attach_mod/displaying_torrent.php

#
#-----[ FIND ]------------------------------------------
#
	$sql = 'SELECT *
		FROM '. BT_TORRENTS_TABLE ."
		WHERE attach_id = $attach_id
		LIMIT 1";

#
#-----[ REPLACE, WITH ]------------------------------------------
#
   $sql = 'SELECT btt.*, u.username
      FROM '. BT_TORRENTS_TABLE .' btt
      LEFT JOIN '.USERS_TABLE.' u on u.user_id=btt.topic_check_uid
      WHERE btt.attach_id = $attach_id
      LIMIT 1';
#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('postrow.attach.tor_reged', array(

#
#-----[ BEFORE, ADD ]------------------------------------------
#
	 switch ($tor_row['topic_check_status'])
	         {
	         case 1: $topic_check_status='<span style="color:indigo;font-weight:bold;">&#9674; </span>.'; break; 
	         case 2: $topic_check_status='<span style="color:green;font-weight:bold;">&radic; </span>.'; break; 
	         case 3: $topic_check_status='<span style="color:#E6C506;font-weight:bold;">&#8776; </span>.'; break; 
	         case 4: $topic_check_status='<span style="color:red;font-weight:bold;">&#8800; </span>.'; break; 
	         case 5: $topic_check_status='<span style="color:blue;font-weight:bold;">&#8734;  </span>'; 
			 $topic_check_status.=($tor_row['topic_check_duble_tid'])?' <a href="viewtopic.'.$phpEx.'?t='.$tor_row['topic_check_duble_tid'].'">(?)</a>.':'.';
		 break; 
	         default: $topic_check_status='<span style="color:red;font-weight:bold;">?  </span>.';
	         }
	if ($tor_row['topic_check_status'])
	{
		$topic_check_status.= '<span style="font-style:italic;">'.' (<a href="profile.'.$phpEx.'?mode=viewprofile&u='.$tor_row['topic_check_uid'].'"><b>'.$tor_row['username'].'</b></a>:'.create_date('d.m.Y, H:i:s', $tor_row['topic_check_date'], $userdata['user_timezone']).')</span>';
	}
	$download_url=(in_array($tor_row['topic_check_status'], array(4, 5)))? $lang['Download']:'<a href="'.$download_link.'">'.$lang['Download'].'</a>';

#
#-----[ FIND ]------------------------------------------
#
		'U_DOWNLOAD_LINK'     => $download_link,

#
#-----[ AFTER, ADD ]------------------------------------------
#
		'U_DOWNLOAD_URL'     => $download_url,
		'TOPIC_CHECK_STATUS' => $topic_check_status,

#
#-----[ FIND ]------------------------------------------
#
	if ($comment)

#
#-----[ BEFORE, ADD ]------------------------------------------
#
	if ($is_auth['auth_mod'])
	{
		$template->assign_block_vars('postrow.attach.tor_reged.mod', array(
			'ACT' => "topic_check_status.$phpEx",
			'SID'       => $userdata['session_id'],
			'ATTACH_ID' => $attach_id,
			'IN_NATIVE_F' => (!$tor_row['topic_check_first_fid'])
		));
	}
	if ($userdata['user_id']==$poster_id && ($tor_row['topic_check_status']=='3' || $tor_row['topic_check_status']=='4') )
	{
		$template->assign_block_vars('postrow.attach.tor_reged.auther', array(
			'ACT' => "topic_check_status.$phpEx",
			'SID'       => $userdata['session_id'],
			'ATTACH_ID' => $attach_id
		));
	}

#
#-----[ OPEN ]------------------------------------------
#
templates/subsilver/viewforum_torrent.tpl

#
#-----[ FIND ]------------------------------------------
#
		<td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}

#
#-----[ IN-LINE FIND ]------------------------------------------
#
{topicrow.NEWEST_POST_IMG}

#
#-----[ IN-LINE BEFORE ADD ]------------------------------------------
#
{topicrow.TOPIC_CHECK_STATUS}

#
#-----[ OPEN ]------------------------------------------
#
templates/subsilver/viewtopic_attach_body.tpl

#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN attach -->

#
#-----[ BEFORE, ADD ]------------------------------------------
#
<script> 
	function add_field(obj) 
	{ 
	        document.getElementById('choose_status').style.display = (obj.value==5)?'inline':'none';
	}
</script>

#
#-----[ FIND ]------------------------------------------
#
		<td width="15%" class="gensmall" rowspan="4" align="center" style="padding: 5px">{postrow.attach.tor_reged.S_UPLOAD_IMAGE}<br /><a href="{postrow.attach.tor_reged.U_DOWNLOAD_LINK}" class="genmed"><b>{L_DOWNLOAD}</b></a><br />{postrow.attach.tor_reged.FILESIZE}</td>

#
#-----[ IN-LINE FIND ]------------------------------------------
#
rowspan="%"

#
#-----[ IN-LINE INCREAMENT ]------------------------------------------
#
rowspan="%+1"

#
#-----[ IN-LINE FIND ]------------------------------------------
#
<a href="{postrow.attach.tor_reged.U_DOWNLOAD_LINK}" class="genmed"><b>{L_DOWNLOAD}</b></a>

#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
{postrow.attach.tor_reged.U_DOWNLOAD_URL}

#
#-----[ FIND ]------------------------------------------
#
	<tr class="row1">
		<td class="genmed">&nbsp;{L_REGED}:&nbsp;</td>
		<td class="genmed">&nbsp;{postrow.attach.tor_reged.REGED_TIME}</td>
	</tr>

#
#-----[ BEFORE ADD ]------------------------------------------
#
	<tr class="row1">
		<td class="genmed">&nbsp;:</td>
		<td class="genmed">&nbsp;{postrow.attach.tor_reged.TOPIC_CHECK_STATUS} 
<!-- BEGIN mod -->
			<form method="POST" action="{postrow.attach.tor_reged.mod.ACT}">
			<select name="topic_check_status" onchange='add_field(this)'>
			<option value="-1">>> <<
			<option value="1">
			<option value="2">O
			<!-- IF postrow.attach.tor_reged.mod.IN_NATIVE_F --><option value="3"><!-- ENDIF -->
			<option value="4">
			<option value="5"></select>
			<input id="choose_status" type="text" name="duble_tid" value="0" size="3" class="post" style="display:none;" />
			<input type="hidden" name="id" value="{postrow.attach.tor_reged.mod.ATTACH_ID}" /><input type="hidden" name="sid" value="{postrow.attach.tor_reged.mod.SID}" />
			<input type="submit" value="">
			</form>
<!-- END mod --> 
<!-- BEGIN auther -->
			<form method="POST" action="{postrow.attach.tor_reged.auther.ACT}">
			<input type="hidden" name="id" value="{postrow.attach.tor_reged.auther.ATTACH_ID}" />
			<input type="hidden" name="sid" value="{postrow.attach.tor_reged.auther.SID}" />
			<input type="checkbox" name="i_edited" value="1" />
			<input type="submit" value=" ">
			</form>

<!-- END auther -->
		</td>
	</tr>

# 
#-----[ OPEN ]------------------------------------------ 
# 
admin/admin_forums.php

# 
#-----[ FIND ]------------------------------------------ 
# 
					$prune_enabled = '';
				}

# 
#-----[ AFTER ADD ]------------------------------------------ 
# 
				//
				// start move topic 
				//
				if( $row['move_enable'] )
				{
					$move_enabled = "checked=\"checked\"";
					$sql = "SELECT *
	               			FROM ".TOPICS_MOVE_TABLE."
        	       			WHERE forum_id = $forum_id";
					if(!$move_result = $db->sql_query($sql))
					{
						 message_die(GENERAL_ERROR, "Automove: Couldn't read auto_move table.", __LINE__, __FILE__);
        			}

					$move_row = $db->sql_fetchrow($move_result);
				}
				else
				{
					$move_enabled = '';
				}


# 
#-----[ FIND ]------------------------------------------ 
# 
				$prune_enabled = '';

# 
#-----[ AFTER ADD ]------------------------------------------ 
# 
				$move_enabled = '';

# 
#-----[ FIND ]------------------------------------------ 
# 
				'S_PRUNE_ENABLED' => $prune_enabled,

# 
#-----[ AFTER ADD ]------------------------------------------ 
# 
				'S_MOVE_ENABLED' => $move_enabled,

# 
#-----[ FIND ]------------------------------------------ 
# 
				'PRUNE_FREQ' => ( isset($pr_row['prune_freq']) ) ? $pr_row['prune_freq'] : 1,

# 
#-----[ AFTER ADD ]------------------------------------------ 
# 
                                'WAITS_DAYS' => ( isset($move_row['waits_days']) ) ? $move_row['waits_days'] : 1,
				'CHECK_FREQ' => ( isset($move_row['check_freq']) ) ? $move_row['check_freq'] : 1,
				'MOVE_FID' => ( isset($move_row['move_fid']) ) ? $move_row['move_fid'] : 'id?',

                                'RECYCLE_WAITS_DAYS' => ( isset($move_row['recycle_waits_days']) ) ? $move_row['recycle_waits_days'] : 1,
				'RECYCLE_CHECK_FREQ' => ( isset($move_row['recycle_check_freq']) ) ? $move_row['recycle_check_freq'] : 1,
				'RECYCLE_MOVE_FID' => ( isset($move_row['recycle_move_fid']) ) ? $move_row['recycle_move_fid'] : 'id?',




# 
#-----[ FIND ]------------------------------------------ 
# 
			$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_parent,

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
# 
prune_enable

# 
#-----[ IN-LINE AFTER ADD ]------------------------------------------ 
# 
, move_enable

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
# 
" . intval($HTTP_POST_VARS['prune_enable']) . "

# 
#-----[ IN-LINE AFTER ADD ]------------------------------------------ 
# 
, " . intval($HTTP_POST_VARS['move_enable']) . "


# 
#-----[ FIND ]------------------------------------------ 
# 
			if( $HTTP_POST_VARS['prune_enable'] )



# 
#-----[ BEFORE ADD ]------------------------------------------ 
# 
			if( $HTTP_POST_VARS['move_enable'] )
			{

				if( $HTTP_POST_VARS['waits_days'] == "" || $HTTP_POST_VARS['check_freq'] == "" || $HTTP_POST_VARS['move_fid'] == "" || $HTTP_POST_VARS['recycle_waits_days'] == "" || $HTTP_POST_VARS['recycle_check_freq'] == "" || $HTTP_POST_VARS['recycle_move_fid'] == "")
				{
					message_die(GENERAL_MESSAGE, '  ');
				}

				$sql = "INSERT INTO ".TOPICS_MOVE_TABLE." (forum_id, waits_days, check_freq, move_fid, recycle_waits_days, recycle_check_freq, recycle_move_fid)
					VALUES('" . $next_id . "', " . intval($HTTP_POST_VARS['waits_days']) . ", " . intval($HTTP_POST_VARS['check_freq']) . ", " . intval($HTTP_POST_VARS['move_fid']) . ", " . intval($HTTP_POST_VARS['recycle_waits_days']) . ", " . intval($HTTP_POST_VARS['recycle_check_freq']) . ", " . intval($HTTP_POST_VARS['recycle_move_fid']) . ")";
				if( !$result = $db->sql_query($sql) )
				{
					message_die(GENERAL_ERROR, "Couldn't insert row in move table", "", __LINE__, __FILE__, $sql);
				}
			}
# 
#-----[ FIND ]------------------------------------------ 
# 
			if( isset($HTTP_POST_VARS['prune_enable']))


# 
#-----[ BEFORE ADD ]------------------------------------------ 
# 
			if( isset($HTTP_POST_VARS['move_enable']))
			{
				if( $HTTP_POST_VARS['move_enable'] != 1 )
				{
					$HTTP_POST_VARS['move_enable'] = 0;
				}
			}

# 
#-----[ FIND ]------------------------------------------ 
# 

				SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = $new_cat

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
# 
prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "

# 
#-----[ IN-LINE AFTER ADD ]------------------------------------------ 
# 
, move_enable = " . intval($HTTP_POST_VARS['move_enable']) . "

# 
#-----[ FIND ]------------------------------------------ 
# 
			if( $HTTP_POST_VARS['prune_enable'] == 1 )

# 
#-----[ BEFORE ADD ]------------------------------------------ 
# 

			if( $HTTP_POST_VARS['move_enable'] == 1 )
			{
				if( $HTTP_POST_VARS['waits_days'] == "" || $HTTP_POST_VARS['check_freq'] == "" || $HTTP_POST_VARS['move_fid'] == "" || $HTTP_POST_VARS['recycle_waits_days'] == "" || $HTTP_POST_VARS['recycle_check_freq'] == "" || $HTTP_POST_VARS['recycle_move_fid'] == "" )
				{
					message_die(GENERAL_MESSAGE, 'Fill the all fields in.');
				}

				$sql = "SELECT *
					FROM ".TOPICS_MOVE_TABLE."
					WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
				if( !$result = $db->sql_query($sql) )
				{
					message_die(GENERAL_ERROR, "Couldn't get forum move Information","",__LINE__, __FILE__, $sql);
				}

				if( $db->sql_numrows($result) > 0 )
				{
					$sql = "UPDATE ".TOPICS_MOVE_TABLE."
						SET waits_days = " . intval($HTTP_POST_VARS['waits_days']) . ", check_freq = " . intval($HTTP_POST_VARS['check_freq']) . ", move_fid = " . intval($HTTP_POST_VARS['move_fid']) . ", recycle_waits_days = " . intval($HTTP_POST_VARS['recycle_waits_days']) . ", recycle_check_freq = " . intval($HTTP_POST_VARS['recycle_check_freq']) . ", recycle_move_fid = " . intval($HTTP_POST_VARS['recycle_move_fid']) . "
				 		WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
				}
				else
				{
					$sql = "INSERT INTO ".TOPICS_MOVE_TABLE." (forum_id, waits_days, check_freq, move_fid, recycle_waits_days, recycle_check_freq, recycle_move_fid)
						VALUES(" . intval($HTTP_POST_VARS[POST_FORUM_URL]) . ", " . intval($HTTP_POST_VARS['waits_days']) . ", " . intval($HTTP_POST_VARS['check_freq']) . ", " . intval($HTTP_POST_VARS['move_fid']) . ", " . intval($HTTP_POST_VARS['recycle_waits_days']) . ", " . intval($HTTP_POST_VARS['recycle_check_freq']) . ", " . intval($HTTP_POST_VARS['recycle_move_fid']) . ")";
				}

				if( !$result = $db->sql_query($sql) )
				{
					message_die(GENERAL_ERROR, "Couldn't Update Forum move Information","",__LINE__, __FILE__, $sql);
				}
			}
# 
#-----[ FIND ]------------------------------------------ 
# 

			$sql = "DELETE FROM " . PRUNE_TABLE . "

# 
#-----[ BEFORE ADD ]------------------------------------------ 
# 
			$sql = "DELETE FROM ".TOPICS_MOVE_TABLE."
				WHERE forum_id = $from_id";
			if( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, "Couldn't delete forum move information!", "", __LINE__, __FILE__, $sql);
			}

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subsilver/admin/forum_edit_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
			<td align="left" valign="middle">&nbsp;<input type="text" name="prune_freq" value="{PRUNE_FREQ}" size="5" class="post" />&nbsp;{L_DAYS}</td>
		  </tr>
	  </table></td>
	</tr>
# 
#-----[ AFTER ADD ]------------------------------------------ 
# 
	<tr> 
	  <td class="row1"> .</td>
	  <td class="row2">
		 <input type="checkbox" name="move_enable" value="1" {S_MOVE_ENABLED} /><br>
		<fieldset class="fieldset" style="margin: 2px;">
			<legend>  .</legend>
			<div style="padding: 4px">
				<div class="gen" style="padding-bottom: 2px">
					  ,       :<input type="text" name="waits_days" value="{WAITS_DAYS}" size="5" class="post" />&nbsp;{L_DAYS}<br> 
					     e: <input type="text" name="check_freq" value="{CHECK_FREQ}" size="5" class="post" />&nbsp;{L_DAYS}<br>
					    : <input type="text" name="move_fid" value="{MOVE_FID}" size="3" class="post" />&nbsp;id
				</div>
			</div>
		</fieldset>
		<fieldset class="fieldset" style="margin: 2px;">
			<legend> -  "".</legend>
			<div style="padding: 4px">
				<div class="gen" style="padding-bottom: 2px">
					 -, : <input type="text" name="recycle_waits_days" value="{RECYCLE_WAITS_DAYS}" size="5" class="post" />&nbsp;{L_DAYS}<br> 
					  - e: <input type="text" name="recycle_check_freq" value="{RECYCLE_CHECK_FREQ}" size="5" class="post" />&nbsp;{L_DAYS}<br>
					   -: <input type="text" name="recycle_move_fid" value="{RECYCLE_MOVE_FID}" size="3" class="post" />&nbsp;id
				</div>
			</div>
		</fieldset>

	</td>
	</tr>

#
#-----[ OPEN ]------------------------------------------
#
tracker.php

#
#-----[ FIND ]------------------------------------------
#
$tor_colspan         = {%:1};   // colspan with all columns

#
#-----[ INCREMENT ]------------------------------------------
#
%:1

#
#-----[ FIND ]------------------------------------------
#
$seed_exist_key  = 'sd';

#
#-----[ AFTER ADD ]------------------------------------------
#
$tcs_checking_key       = 'cg';
$tcs_correct_key        = 'ct';
$tcs_almostcorrect_key  = 'at';
$tcs_notcorrect_key     = 'nt';
$tcs_duble_key          = 'de';
$tcs_notchecked_key     = 'nd';
$show_tcs_key           = 'tcs';


#
#-----[ FIND ]------------------------------------------
#
$seed_exist_val  = $def_seed_exist_val  = 0;

#
#-----[ AFTER ADD ]------------------------------------------
#
$tcs_checking_val       = $def_tcs_checkig_val        = 1;
$tcs_correct_val        = $def_tcs_correct_val        = 1;
$tcs_almostcorrect_val  = $def_tcs_almostcorrect_val  = 1;
$tcs_notcorrect_val     = $def_tcs_notcorrect_val     = 1;
$tcs_duble_val          = $def_tcs_duble_val          = 1;
$tcs_notchecked_val     = $def_tcs_notchecked_val     = 1;
$show_tcs_val           = $def_show_tcs_val           = 1;

#
#-----[ FIND ]------------------------------------------
#
	checkbox_get_val ($seed_exist_key,  $seed_exist_val,  $def_seed_exist_val);

#
#-----[ AFTER ADD ]------------------------------------------
#
	checkbox_get_val ($tcs_checking_key,       $tcs_checking_val,       $def_tcs_checkig_val);
	checkbox_get_val ($tcs_correct_key,        $tcs_correct_val,        $def_tcs_correct_val);
	checkbox_get_val ($tcs_almostcorrect_key,  $tcs_almostcorrect_val,  $def_tcs_almostcorrect_val);
	checkbox_get_val ($tcs_notcorrect_key,     $tcs_notcorrect_val,     $def_tcs_notcorrect_val);
	checkbox_get_val ($tcs_duble_key,          $tcs_duble_val,          $def_tcs_duble_val);
	checkbox_get_val ($tcs_notchecked_key,     $tcs_notchecked_val,     $def_tcs_notchecked_val);
	checkbox_get_val ($show_tcs_key,           $show_tcs_val,           $def_show_tcs_val);

#
#-----[ FIND ]------------------------------------------
#
		$seed_exist_key  => $seed_exist_val,

#
#-----[ AFTER ADD ]------------------------------------------
#
		$tcs_checking_key       => $tcs_checking_val,
		$tcs_correct_key        => $tcs_correct_val,
		$tcs_almostcorrect_key  => $tcs_almostcorrect_val,
		$tcs_notcorrect_key     => $tcs_notcorrect_val,
		$tcs_duble_key          => $tcs_duble_val,
		$tcs_notchecked_key     => $tcs_notchecked_val,
		$show_tcs_key           => $show_tcs_val,

#
#-----[ FIND ]------------------------------------------
#
	$seed_exist  = ($seed_exist_val) ? TRUE : FALSE;

#
#-----[ AFTER ADD ]------------------------------------------
#
	$tcs_ids .= ($tcs_checking=$tcs_checking_val) ? ( ( ( $tcs_ids != '' ) ? ', ' : '' ) . 1) : '';
	$tcs_ids .= ($tcs_correct=$tcs_correct_val) ? ( ( ( $tcs_ids != '' ) ? ', ' : '' ) . 2) : '';
	$tcs_ids .= ($tcs_almostcorrect=$tcs_almostcorrect_val) ? ( ( ( $tcs_ids != '' ) ? ', ' : '' ) . 3) : '';
	$tcs_ids .= ($tcs_notcorrect=$tcs_notcorrect_val) ? ( ( ( $tcs_ids != '' ) ? ', ' : '' ) . 4) : '';
	$tcs_ids .= ($tcs_duble=$tcs_duble_val) ? ( ( ( $tcs_ids != '' ) ? ', ' : '' ) . 5) : '';
	$tcs_ids .= ($tcs_notchecked=$tcs_notchecked_val) ? ( ( ( $tcs_ids != '' ) ? ', ' : '' ) . 0) : '';
        $hide_tcs = (!$show_tcs_val) ? 1 : 0;

#
#-----[ FIND ]------------------------------------------
#
		$where_sql .= ($seed_exist) ? '
				AND tr.seeder = 1
		' :	'';

#
#-----[ AFTER ADD ]------------------------------------------
#
		$where_sql .= ($tcs_ids!='') ? '
				AND tor.topic_check_status in ('.$tcs_ids.')
		' :	'';

#
#-----[ FIND ]------------------------------------------
#
				$row_num++;

#
#-----[ AFTER ADD ]------------------------------------------
#
				 switch ($tor_row['topic_check_status'])
				         {
					        case 1: 
							$tcs_id='<span style="color:indigo;">&#9674;</span>'; 
							$tcs_title='';
						break; 
						case 2: 
							$tcs_id='<span style="color:green;">&radic;</span>'; 
							$tcs_title='';
						break; 
						case 3: 
							$tcs_id='<span style="color:#E6C506;">&#8776;</span>'; 
							$tcs_title='';
						break; 
					        case 4: 
							$tcs_id='<span style="color:red;">&#8800;</span>'; 
							$tcs_title='';
						break; 
					        case 5: 
							$tcs_id='<span style="color:blue;">&#8734;</span>'; 
							$tcs_title='';
						break; 
					        default: 
							$tcs_id='<span style="color:red;">?</span>';
							$tcs_title=' ';

				         }
#
#-----[ FIND ]------------------------------------------
#
					'TITLE_AUTHOR' => ($show_author_val) ? '' : ' by: '. $tor_row['username'] .' ',

#
#-----[ AFTER ADD ]------------------------------------------
#
					'TCS_ID'       => $tcs_id,
					'TCS_TITLE'    => $tcs_title,

#
#-----[ FIND ]------------------------------------------
#
	'SHOW_AUTHOR_NAME'    => $show_author_key,

#
#-----[ AFTER ADD ]------------------------------------------
#
	'SHOW_TCS_ID'         => $show_tcs_key,
	'SHOW_TCS_VAL'        => $show_tcs_val,
	'SHOW_TCS_CHECKED'    => ($show_tcs_val) ? $ch : '',

	'TCS_CHECKING_NAME'          => $tcs_checking_key,
	'TCS_CHECKING_VAL'           => $tcs_checking_val,
	'TCS_CHECKING_CHECKED'       => ($tcs_checking) ? $ch : '',
	'TCS_CORRECT_NAME'           => $tcs_correct_key,
	'TCS_CORRECT_VAL'            => $tcs_correct_val,
	'TCS_CORRECT_CHECKED'        => ($tcs_correct) ? $ch : '',
	'TCS_ALMOSTCORRECT_NAME'     => $tcs_almostcorrect_key,
	'TCS_ALMOSTCORRECT_VAL'      => $tcs_almostcorrect_val,
	'TCS_ALMOSTCORRECT_CHECKED'  => ($tcs_almostcorrect) ? $ch : '',
	'TCS_NOTCORRECT_NAME'        => $tcs_notcorrect_key,
	'TCS_NOTCORRECT_VAL'         => $tcs_notcorrect_val,
	'TCS_NOTCORRECT_CHECKED'     => ($tcs_notcorrect) ? $ch : '',
	'TCS_DUBLE_NAME'             => $tcs_duble_key,
	'TCS_DUBLE_VAL'              => $tcs_duble_val,
	'TCS_DUBLE_CHECKED'          => ($tcs_duble) ? $ch : '',
	'TCS_NOTCHECKED_NAME'        => $tcs_notchecked_key,
	'TCS_NOTCHECKED_VAL'         => $tcs_notchecked_val,
	'TCS_NOTCHECKED_CHECKED'     => ($tcs_notchecked) ? $ch : '',

#
#-----[ FIND ]------------------------------------------
#
$tor_colspan = $tor_colspan - $hide_cat - $hide_forum - $hide_author - $hide_speed;

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$hide_author

#
#-----[ IN-LINE AFTER ADD ]------------------------------------------
#
- $hide_tcs 

#
#-----[ FIND ]------------------------------------------
#
	'SHOW_AUTHOR'        => $show_author_val,

#
#-----[ AFTER ADD ]------------------------------------------
#
	'SHOW_TCS'           => $show_tcs_val,

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/tracker.tpl

#
#-----[ FIND ]------------------------------------------
#
									<div class="gen"><nobr><label for="only_new"><input id="only_new" type="checkbox"

#
#-----[ AFTER ADD ]------------------------------------------
#
										<br />
										<label title='' for="tcs_checking"><input id="tcs_checking" type="checkbox" name="{TCS_CHECKING_NAME}" value="1" {TCS_CHECKING_CHECKED} /><span style="color:indigo;">&#9674;</span>&nbsp;</label>
										<label title='' for="tcs_correct"><input id="tcs_correct" type="checkbox" name="{TCS_CORRECT_NAME}" value="1" {TCS_CORRECT_CHECKED} /><span style="color:green;">&radic;</span>&nbsp;</label>
										<label title='' for="tcs_almostcorrect"><input id="tcs_almostcorrect" type="checkbox" name="{TCS_ALMOSTCORRECT_NAME}" value="1" {TCS_ALMOSTCORRECT_CHECKED} /><span style="color:#E6C506;">&#8776;</span>&nbsp;</label>
										<label title='' for="tcs_notcorrect"><input id="tcs_notcorrect" type="checkbox" name="{TCS_NOTCORRECT_NAME}" value="1" {TCS_NOTCORRECT_CHECKED} /><span style="color:red;">&#8800;</span>&nbsp;</label>
										<label title='' for="tcs_duble"><input id="tcs_duble" type="checkbox" name="{TCS_DUBLE_NAME}" value="1" {TCS_DUBLE_CHECKED} /><span style="color:blue;">&#8734;</span>&nbsp;</label>
										<label title=' ' for="tcs_notchecked"><input id="tcs_notchecked" type="checkbox" name="{TCS_NOTCHECKED_NAME}" value="1" {TCS_NOTCHECKED_CHECKED} /><span style="color:red;">?</span>&nbsp;</label>

#
#-----[ FIND ]------------------------------------------
#
											<div class="gen"><nobr><label for="show_speed"><input id="show_speed

#
#-----[ AFTER ADD ]------------------------------------------
#
											<div class="gen"><nobr><label for="show_tcs"><input id="show_tcs" type="checkbox" name="{SHOW_TCS_ID}" value="1" {SHOW_TCS_CHECKED} /> &nbsp;</label></nobr></div>

#
#-----[ FIND ]------------------------------------------
#
		<!-- IF SHOW_AUTHOR -->
		<th align="center" nowrap="nowrap" title="{L_AUTHOR}"> Author </th>
		<!-- ENDIF -->

#
#-----[ AFTER ADD ]------------------------------------------
#
		<!-- IF SHOW_TCS -->
		<th align="center" nowrap="nowrap" title=" ">ST</th>
		<!-- ENDIF -->

#
#-----[ FIND ]------------------------------------------
#
		<!-- IF SHOW_AUTHOR -->
		<td align="center" class="genmed"><a class="genmed" href="{tor.POSTER_HREF}">{tor.USERNAME}</a></td>
		<!-- ENDIF -->
#
#-----[ AFTER ADD ]------------------------------------------
#
		<!-- IF SHOW_TCS -->
		<td align="center" class="genmed" title="{tor.TCS_TITLE}">{tor.TCS_ID}</td>
		<!-- ENDIF -->

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM